package com.hxy.health.platform.pojo;

import java.util.Date;
import java.util.Objects;

public class Cart {
    /** 自增主键 */
    private Integer id;

    /** 产品ID */
    private Integer productId;

    /** 邮件 */
    private String email;

    /** 产品名称 */
    private String productName;

    /** 数量 */
    private Integer quantity;

    /** 产品价格 */
    private String productPrice;

    /** 产品总价 */
    private String productTotalPrice;

    /** 图片地址 */
    private String productImg;

    /** 创建时间 */
    private Date createTime;

    /** 更新时间 */
    private Date updateTime;

    public Cart(Integer id, Integer productId, String email, String productName, Integer quantity, String productPrice, String productTotalPrice, String productImg, Date createTime, Date updateTime) {
        this.id = id;
        this.productId = productId;
        this.email = email;
        this.productName = productName;
        this.quantity = quantity;
        this.productPrice = productPrice;
        this.productTotalPrice = productTotalPrice;
        this.productImg = productImg;
        this.createTime = createTime;
        this.updateTime = updateTime;
    }

    public Cart() {
        super();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName == null ? null : productName.trim();
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public String getProductPrice() {
        return productPrice;
    }

    public void setProductPrice(String productPrice) {
        this.productPrice = productPrice == null ? null : productPrice.trim();
    }

    public String getProductTotalPrice() {
        return productTotalPrice;
    }

    public void setProductTotalPrice(String productTotalPrice) {
        this.productTotalPrice = productTotalPrice == null ? null : productTotalPrice.trim();
    }

    public String getProductImg() {
        return productImg;
    }

    public void setProductImg(String productImg) {
        this.productImg = productImg == null ? null : productImg.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Cart cart = (Cart) o;
        return Objects.equals(productId, cart.productId) &&
                Objects.equals(email, cart.email) &&
                Objects.equals(productName, cart.productName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(productId, email, productName);
    }
}